<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src=" http://libs.baidu.com/json/json2/json2.js"></script>
<script>
var user;
$(document).ready(function(){
  $("button").click(function(){
    $.get("/user/findUserById?id=2",function(data,status){
      $("p#forId").html(data.id);
      $("h2#forName").html("这是用户名"+data.name);
    });
  });
});
</script>
<title>Insert title here</title>
</head>
<body>
<button>ajax get request</button>
<div><p id="forId"></p>
<h2 id="forName">这里是显示用户名的地方</h2></div>

</body>
</html>